define(['npm/mockjs/dist/mock-min'], function(mock) {
  var WB2 = {};

  WB2.checkLogin = function() {
    return true;
  }

  WB2.login = function(cb) {
    alert('login');
    cb();
  }

  WB2.anyWhere = function(cb) {
    var W = {
      parseCMD: function(url, cb, data, options) {
        switch (url) {
          case "/statuses/home_timeline.json":
            cb(mock.mock({
              'statuses|1-10': [{
                'id|+1': 1,
                'text': '@sentence'
              }]
            }), true);
            break;
          case '/comments/show.json':
            cb(mock.mock({
              'comments|1-10': [{
                'id|+1': 1,
                'text': '@sentence',
                'source': '<a href="#"> @word </a>',
                'created_at': '@date',
                'status': {
                  'favorited|1': true
                }
              }]
            }), true);
            break;
          case '/statuses/update.json':
            cb({
              id: 213,
              text: data.status
            }, true)
            break;
          default:
            cb({}, true);
            break;
        }
      }
    }

    cb(W);
  }

  window.WB2 = WB2;
})
